import java.util.Arrays;

class Solution1 {
    public int[] addTwoNumbers(int[] l1, int[] l2) {
        int b=l1.length;
        int []arr1=new int [b];
        int a=0;
        for(int i=0;i<l1.length-1;i++)
        {
            a=l1[i]+l2[i];
            if(a<10){
                arr1[i]=a;
            }
            else if (a==10){
                arr1[i]=0;
            }
            else if(a>10)
            {
                arr1[i]=a%10;
                a=a/10;
            }
        }
        return arr1;
    }
}
class Solution {
    public int[] twoSum(int[] nums, int target) {
        int[]arr1={0,0};
        for (int i=0;i<nums.length;i++){
            for(int j=i+1;j<nums.length;j++){
                if(nums[i]+nums[j]==target)
                {
                    arr1[0]=i;
                    arr1[1]=j;
                }
            }
        }
        return arr1;

    }
}
public class work {
    public static void main(String[] args) {
        int []arr={2,4,3};
        int []arr1={5,6,4};
        Solution1 so=new Solution1();
        System.out.println(Arrays.toString(so.addTwoNumbers(arr,arr1)));
    }
    public static void main1(String[] args) {
        int a=10;
        int []arr=new int[a];
        Solution so=new Solution();
       int []nums={2,7,11,15};
       int target = 9;
        System.out.println(Arrays.toString(so.twoSum(nums,target)));
    }

}
